<?php

class Album extends AppModel {
  public $name = 'Album';
  public $belongsTo = array('Category'=>array(
      'className'=> 'Category',
      'foreignKey'=>'category_id',
      'type' =>'inner'
 ));
  public $hasMany = array('Photo'=> array('className'=>'Photo', 'foreign_key'=>'album_id', 'dependent'=>true, 'order'=>'Photo.image_order ASC'));

  public $validate = array(
      'Album.name' => array(
          'name' => 'notEmpty',
          'message'=>'Name is required'
      ),
      'Album.category_id' => array(
          'name' => 'notEmpty',
          'message'=>'Category is required'
      )
  );
   //http://book.cakephp.org/1.3/view/1042/belongsTo
  
}

?>
